 
 
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head >
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout 后台大布局 - Layui</title>
<link rel="stylesheet" th:href="@{./layui/css/layui.css}" >
</head>
<body class="layui-layout-body">

<div class="layui-layout layui-layout-admin">
  <div class="layui-header" th:insert="~{common/admin-common :: headerbar}">

    <!-- 头部区域（可配合layui已有的水平导航） -->

  </div>

  <div class="layui-side layui-bg-black" th:insert="~{common/admin-common :: leftsidebar}">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->

    </div>
  </div>

  <div class="layui-body">
    <!-- 内容主体区域 -->
      <table  class="layui-hide" id="demotable" >
  </div>


</div>
<script th:src="@{./layui/layui.js}"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });

    layui.use('table', function(){
        var table = layui.table;
        //展示异步数据
        table.render({
            elem: '#demotable'
            ,url: '/hellouser_json'
            //,skin: 'line' //表格风格
            ,even: true
            ,page: true //是否显示分页
            ,cols: [
                [ //标题栏
                    {field: 'id', title: 'id'}
                    ,{field: 'username', title: '用户名称'}
                    ,{field: 'password', title: '用户密码'}
                ]
            ]
            ,limit: 10   //默认值
            ,limits: [10, 20, 30] //设置每页显示几条
        });
    });
</script>
</body>
</html>
